package com.hoshiicloud.shxping.feign;

import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.market.entity.activities.Slideshow;
import com.hoshiicloud.market.entity.market.ShareInfo;
import com.hoshiicloud.shxping.feign.hystrix.HystrixUserFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author yangcheng
 * @version 1.0
 * @title: IMarketFeignService
 * @description: 营销微服务FeignClient
 * @date 2019/8/5 9:45
 * @mail maiboyc@163.com
 */
@FeignClient(name = "hoshiicloud-market", fallback = HystrixUserFeignFallback.class)
public interface IMarketFeignService {

    /**
     * 根据ID查找分享信息
     * @param id ID
     * @return Response<ShareInfo>
     */
    @RequestMapping(value = "/shareInfo/{id}", method = RequestMethod.GET)
    Response<ShareInfo> getShareInfoById(@PathVariable("id") Long id);

    /**
     * 保存分享信息
     * @param entity 新增参数
     * @return Response<Long>
     */
    @RequestMapping(value = "/shareInfo/save/", method = RequestMethod.POST)
    Response<Long> saveShareInfo(@RequestBody ShareInfo entity);

    /**
     * 查询分享信息
     * @param param 查询参数
     * @return Response<List<ShareInfo>>
     */
    @RequestMapping(value = "/shareInfo/list/", method = RequestMethod.POST)
    Response<List<ShareInfo>> listShareInfo(@RequestBody ShareInfo param);

    /**
     * 查询banner图片
     * @param param 查询参数
     * @return Response<List<Banner>>
     */
    @RequestMapping(value = "/market/slideshow/list", method = RequestMethod.POST)
    Response<List<Slideshow>> listBannerInfo(@RequestBody Slideshow param);
}
